<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script language="javaScript">
        now = new Date();
        hour = now.getHours()
        if (hour < 6) {
            console.log("凌晨好!")
        } else if (hour < 9) {
            console.log("早上好!")
        } else if (hour < 12) {
            console.log("上午好!")
        } else if (hour < 14) {
            console.log("中午好!")
        } else if (hour < 17) {
            console.log("下午好!")
        } else if (hour < 19) {
            console.log("傍晚好!")
        } else if (hour < 22) {
            console.log("晚上好!")
        } else { console.log("夜里好!") } 
    </script>
</body>
</html>